/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 *
 */

import { MetricService } from '../metric-service.js';

import { BaseEvent, EventAdditional, EventBody, EventHead, MetricEventType } from './base-event.js';

export class GaugeEventAdditional implements EventAdditional {
  utilization: number;

  constructor(utilization: number) {
    this.utilization = utilization;
  }
}

export class GaugeEvent extends BaseEvent {
  additional: GaugeEventAdditional;

  constructor(id: string, name: string, description: string, pid: number, tid: string, utilization: number) {
    super(new EventHead(id, name, description, MetricEventType.GAUGE), new EventBody(pid, tid));
    this.additional = new GaugeEventAdditional(utilization);
    this.body.startTime = Number(process.hrtime.bigint());
  }
}
